/**
 * Created with  IntelliJ IDEA .
 * Description:
 * User: lenovo
 * Date: 2025-${ MONTH }-25
 * Time: 19:42
 */

class  MyValue{
    public int val;

    public MyValue(int val) {
        this.val = val;
    }
}

public class Test {

    public static void main(String[] args) {

        MyValue myValue1 = new MyValue(55);
        MyValue myValue2 = new MyValue(66);

        System.out.println("交换前"+myValue1.val+" "+myValue2.val);
        Swap(myValue1,myValue2);
        System.out.println("交换后"+myValue1.val+" "+myValue2.val);
    }

    public static void Swap(MyValue o1 ,MyValue o2){
        int temp = o1.val;
        o1.val = o2.val;
        o2.val = temp;
    }
}
